<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>合众人寿公益平台客户管理系统</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="<%=request.getContextPath()%>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=request.getContextPath()%>/html/js/Calendar.js"
			charset="utf-8"></script>
			
			<style>
		body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th{margin:0;padding:0; font-family:"宋体",Arial, Helvetica, sans-serif;}
		li{ list-style:none;}
		input{ background:none;}
		.clear{ zoom:1;}
		.clear:after{content:""; display:block; clear:both;}
		</style>

		<SCRIPT type="text/javascript">
     function check(){
     	if(leftTrim(document.getElementById("name").value) == ''){
     	   alert("请输入名称!");
     	   return false;
     	}
     	if(leftTrim(document.getElementById("number").value)== ''){
     	   alert("请输入数量!");
     	   return false;
     	}
     	if(leftTrim(document.getElementById("school").value) == ''){
     	   alert("请输入学校!");
     	   return false;
     	}
     	if(leftTrim(document.getElementById("subCompanyId").value) == ''){
     	   alert("请选择分公司!");
     	   return false;
     	} 
     	if(document.getElementById("subCityId").value == ''){
     	   alert("请选择中支!");
     	   return false;
     	} 
     	document.getElementById("subComName").value = document.getElementById("subCompanyId").options[document.getElementById("subCompanyId").selectedIndex].innerText;
     	document.getElementById("subCityName").value = document.getElementById("subCityId").options[document.getElementById("subCityId").selectedIndex].innerText;
     }
     
     
     function   leftTrim(ui){  
	    var   notValid=/^\s/;  
	    while(notValid.test(ui)){  
	      ui=ui.replace(notValid,"");}  
       return   ui; 
     }  
	 </SCRIPT>

	</head>

	<body>
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							爱心之旅活动/成果/添加成果信息
						</h3>
					</div>
					<div class="ct">
						<form
							action="<%=request.getContextPath()%>/subAchievement/saveSubAchievement.do"
							method="post" onsubmit="return check()">
							<input type="hidden" name="journeyLoveId" value="${journeyLoveId}" >
							<div class="add">

								<table>
									<tr>
										<td align="right">
											<span>名称<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<input type="text" name="subAchievement.sub_achieveName" id="name" />
										</td>
										<td align="right">
											<span>数量<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<input type="text" name="subAchievement.sub_achieveNumber" id="number" />
										</td>
									</tr>
									<tr>
										<td align="right">
											<span>分公司<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<select name="subAchievement.subCompany" id="subCompanyId"
												style="width: 155;">
												<option value="${subAchievement.subCompany}">${subAchievement.subComName}</option> 
											</select>
										</td>
										<td align="right">
											<span>中支<font color="red">(*)</font>：</span>
										</td>
										<td class="t2">
											<select name="subAchievement.subCity" id="subCityId"
												style="width: 155;">
												<option value="${subAchievement.subCity}">${subAchievement.subCityName}</option> 
											</select>
										</td>
									</tr>
									<tr>
										<td align="right">
											<span>学校<font color="red">(*)</font>：</span>
										</td>
										<td class="t2" colspan="3">
											<input type="text" name="subAchievement.sub_school" id="school" />
										</td>
									</tr>
									<tr>
                                    <td>
                                      <input type="hidden" name="subAchievement.subComName" id="subComName"/>
                                    </td>
                                    <td>
                                      <input type="hidden" name="subAchievement.subCityName" id="subCityName"/>
                                    </td>
                                  </tr>
								</table>
							</div>
							<div class="btn">
								<input type="submit" value="保存" />
								<input type="button" value="返回"
									onclick="javascript :history.back(-1);" />
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

	</body>
</html>
